package com.feicheng.house.controller.customer;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.feicheng.house.entity.BuyOrderClientShopVo;
import com.feicheng.house.result.ResultInfo;
import com.feicheng.house.service.IBuyOrderClientShopVoService;

/**
 * <p>
 * VIEW 前端控制器
 * </p>
 *
 * @author feichengTech
 * @since 2021-11-25
 */
@RestController
@RequestMapping("/customer/buy-order-client-shop-vo")
public class CustomerBuyOrderClientShopVoController {
	@Autowired
	IBuyOrderClientShopVoService iBuyOrderClientShopVoService;
	/**
	 * 根据id查询
	 * @param buyOrderId
	 * @return 查到的订单详情
	 */
	@GetMapping("/info")
	ResultInfo seleOne(Integer buyOrderId) {
		return iBuyOrderClientShopVoService.seleOne(buyOrderId);
	}
	/**
	 * 根据clientId查询客户的所有订单
	 * @param currentPage
	 * @param pageSize	
	 * @param clientId
	 * @return 查询到的订单详情
	 */
	@GetMapping("/page")
	public ResultInfo selectOrders(
			@RequestParam(defaultValue = "1")Integer currentPage, 
			@RequestParam(defaultValue = "10")Integer pageSize,
			Integer clientId) {
		return iBuyOrderClientShopVoService.selectOrders(currentPage, pageSize, clientId);
	}
}